#include <iostream>
#include <cstdio>
#include <queue>
#include <algorithm>
using namespace std;

const int MAXN = 1e5+5;
int n;
int a[MAXN];
deque<int> q;

int main()
{
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	scanf("%d",&n);
	for(int i=1;i<=n;++i)
		scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	q.push_back(a[1]);
	for(int i=2;i<=n;++i)
	{
		if(a[i]>q.back())
			q.pop_back();
		else if(a[i]>q.front())
			q.pop_front();
		q.push_back(a[i]);
	}
	printf("%d\n",(int)q.size());
	fclose(stdin);
	fclose(stdout);
	return 0;
}
